package com.gdsdxy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gdsdxy.entity.Blog;
import com.gdsdxy.mapper.BlogMapper;
import com.gdsdxy.service.IBlogService;
import org.springframework.stereotype.Service;

@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IBlogService {

    /**
     * 根据博客id查找作者，然后判断是否为 楼主
     * @param bid
     * @return uid
     */
    @Override
    public Long finduidByBid(Long bid) {
        Blog blog = query().eq("bid", bid).one();
        Long uid = blog.getUid();
        return uid;
    }
}
